home *** CD-ROM | disk | FTP | other *** search
- !
- ! A Generic 38400 modem CCL script...
- !
- @ORIGINATE
- @ANSWER
- !
- @LABEL 1
- serreset 38400, 0, 8, 1
- !
- ! Reset modem to factory settings
- !
- settries 0
- matchclr
- matchstr 1 3 "OK\13\10"
- @LABEL 2
- write "AT&F\13"
- matchread 20
- inctries
- iftries 2 59
- !
- ! No response (well, no "OK".); Try wiggling the DTR line
- !
- DTRClear
- pause 5
- DTRSet
- jump 2
- !
- !
- !
- @LABEL 3
- matchstr 1 4 "OK\13\10"
- write "AT\13"
- matchread 30
- jump 59
- !
- ! Assuming that the modem speaker is on, if str 2 is "0" turn it off
- !
- @LABEL 4
- ifstr 2 6 "1"
- matchstr 1 6 "OK\13\10"
- write "ATM0\13"
- matchread 30
- jump 59
-
- !
- ! The modem is ready so enable answering, or originate a call
- !
- @LABEL 6
- ifANSWER 30
- note "Dialing ^1" 3
- write "ATDT^1\13"
- !
- @LABEL 9
- matchstr 1 11 "CONNECT 1200\13\10"
- matchstr 2 12 "CONNECT 2400\13\10"
- matchstr 3 13 "CONNECT 4800\13\10"
- matchstr 4 14 "CONNECT 9600\13\10"
- matchstr 5 15 "CONNECT 14400\13\10"
- matchstr 6 50 "NO CARRIER\13\10"
- matchstr 7 50 "ERROR\13\10"
- matchstr 8 52 "NO DIALTONE\13\10"
- matchstr 9 53 "BUSY\13\10"
- matchstr 10 54 "NO ANSWER\13\10"
- matchread 900
- jump 59
- !
- @LABEL 11
- note "Communicating at 1200 bps." 2
- CommunicatingAt 1200
- serreset 1200, 0, 8, 1
- jump 20
- !
- @LABEL 12
- note "Communicating at 2400 bps." 2
- CommunicatingAt 2400
- serreset 2400, 0, 8, 1
- jump 20
- !
- @LABEL 13
- note "Communicating at 4800 bps." 2
- CommunicatingAt 4800
- serreset 4800, 0, 8, 1
- jump 20
- !
- @LABEL 14
- note "Communicating at 9600 bps." 2
- CommunicatingAt 9600
- serreset 9600, 0, 8, 1
- jump 20
- !
- @LABEL 15
- note "Communicating at 14400 bps." 2
- CommunicatingAt 14400
- serreset 19200, 0, 8, 1
- !
- @LABEL 20
- ifANSWER 21
- pause 30
- @LABEL 21
- exit 0
- !
- ! @ANSWER
- ! Set up the modem to answer
- !
- @LABEL 30
- write "ATS0=1\13"
- matchstr 1 31 "OK\13\10"
- matchread 30
- jump 59
- !
- @LABEL 31
- matchstr 1 32 "RING\13\10"
- matchstr 2 11 "CONNECT 1200\13\10"
- matchstr 3 12 "CONNECT 2400\13\10"
- matchstr 4 13 "CONNECT 4800\13\10"
- matchstr 5 14 "CONNECT 9600\13\10"
- matchstr 6 15 "CONNECT 14400\13\10"
- matchstr 7 50 "NO CARRIER\13\10"
- matchstr 8 50 "ERROR\13\10"
- matchstr 9 52 "NO DIALTONE\13\10"
- matchstr 10 53 "BUSY\13\10"
- matchstr 10 54 "NO ANSWER\13\10"
- matchread 700
- jump 31
- !
- @LABEL 32
- userhook 1
- note "Answering the phone…" 2
- jump 31
- !
- ! 50: error messages
- !
- @LABEL 50
- exit -6021
- !
- @LABEL 52
- exit -6020
- !
- @LABEL 53
- exit -6022
- !
- @LABEL 54
- exit -6023
- !
- @LABEL 59
- exit -6019
- !
- ! Attempt to hang up the modem
- !
- @HANGUP
- @LABEL 60
- settries 0
- @LABEL 61
- matchclr
- matchstr 1 62 "OK\13\10"
- matchstr 2 62 "NO CARRIER\13\10"
- matchstr 3 62 "ERROR\13\10"
- write "ATH\13"
- matchread 10
- inctries
- iftries 3 62
- !
- ! No response to "AT", attempt escape sequence
- !
- DTRClear
- pause 5
- DTRSet
- write "+++"
- matchclr
- matchstr 1 61 "OK\13\10"
- matchread 15
- jump 61
- !
- @LABEL 62
- ! set modem back to factory settings
- pause 5
- write "AT&F\13"
- matchclr
- matchstr 1 63 "OK\13\10"
- matchread 30
- !
- @LABEL 63
- exit 0
-